<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    // 从键盘分别输入月、日，判断这一天是当年的第几天
    var month = prompt("请输入第一个数");
    var day = prompt("请输入第二个数");
    var sum = 0;

    switch (month){
        case "12":
            sum+=30;
        case "11":
            sum+=31;
        case "10":
            sum+=30;
        case "9":
            sum+=31;
        case "8":
            sum+=30;
        case "7":
            sum+=31;
        case "6":
            sum+=30;
        case "5":
            sum+=31;
        case "4":
            sum+=30;
        case "3":
            sum+=31;
        case "2":
            sum+=28;
        case "1":
            sum+=parseInt(day);
    }

    console.log("这一天为本年的第\""+sum+"\"天")
</script>
</html>